﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>日历</title>

    <script type="text/javascript" src="../../WF/Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../WF/Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/config.js" type="text/javascript"></script>
    <script src="../../WF/Comm/Gener.js" type="text/javascript"></script>
    <!--<base target="_self" />-->

    <link rel="stylesheet" href="/App/layuiadmin/layui/css/layui.css" media="all">
    <script src="/App/layuiadmin/layui/layui.js"></script>

    <style>
        body {
            background: #fff;
        }

        .schedule {
            margin-top: 20px;
        }

        .schedule .title {
            border-left: 2px solid #009688;
            display: inline-block;
            padding-left: 10px;
            font-weight: bold;
            font-size: 16px;
            margin-bottom: 20px;
        }
    </style>

</head>
<body>
    <div class="layui-container">
        <div class="schedule">
            <div class="title">新建日程</div>
            <form lay-filter="calendarForm" class="layui-form model-form">
                <input name="id" id="id" type="hidden" />
                <div class="layui-form-item">
                    <label class="layui-form-label">日程主题</label>
                    <div class="layui-input-block">
                        <input name="TB_Name" id="TB_Name" placeholder="请输入日程主题" type="text" class="layui-input" maxlength="50" lay-verify="required" required />
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">开始</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="TB_DTStart" name="TB_DTStart" placeholder="yyyy-MM-dd HH:mm:ss" lay-verify="required" required>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">持续</label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="TB_DTEnd" name="TB_DTEnd" placeholder="yyyy-MM-dd HH:mm:ss" lay-verify="required" required>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">日程描述</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" name="TB_MiaoShu" id="TB_MiaoShu" class="layui-textarea"></textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">位置</label>
                    <div class="layui-input-block">
                        <textarea placeholder="位置" name="TB_Local" id="TB_Local" class="layui-textarea"></textarea>
                    </div>
                </div>

                <div class="layui-form-item text-right">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-filter="submit" lay-submit>保存</button>
                        <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <script>
        layui.use(['form', 'layer', 'laydate'], function () {
            var form = layui.form, $ = layui.jquery, laydate = layui.laydate;

            form.on('submit(submit)', function (data) {

                //console.log(data.field);

                var en = new Entity("BP.CCOA.Schedule");
                en.CopyForm();

              //  en.Name = $("#TB_Name").val();
                en.Name = $("#TB_Name").val();
                en.Insert();

                //  alert('保存成功.');

                //en.PageID = menuNo;
                //en.Name = name;
                //en.WinDocModel = winDocModel; //窗口内容模式.
                //en.Icon = "icon-fire";
                //en.Docs = intdocs;
                //en.Insert();

                /* var loading = layer.load(1, { shade: [0.1, '#fff'] });
                 $.post("", data.field, function (res) {
                     layer.close(loading);
                     if (res.code > 0) {
                         layer.msg(res.msg, { time: 1800, icon: 1 }, function () {
                             location.href = res.url;
                         });
                     } else {
                         layer.msg(res.msg, { time: 1800, icon: 2 });
                     }
                 });*/
            });
            laydate.render({
                elem: '#TB_DTStart'
                , type: 'datetime'
            });
            laydate.render({
                elem: '#TB_DTEnd'
                , type: 'datetime'
            });
        });
    </script>
</body>
</html>